package com.soft.javase.day06.object.deepcopy;

/**
 * @author yzh
 * @desc TODO
 * @date 2025/4/24
 */
public class Phone implements Cloneable{
    private String brand;
    private double price;

    public Phone(String brand, double price) {
        this.brand = brand;
        this.price = price;
    }

    @Override
    protected Phone clone() throws CloneNotSupportedException {
        return (Phone)super.clone();
    }

    @Override
    public String toString() {
        return "Phone{" +
                "brand='" + brand + '\'' +
                ", price=" + price +
                '}';
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
